package com.qqzone.dao.impl;

import com.myssm.basedao.BaseDAO;
import com.qqzone.dao.HostReplyDAO;
import com.qqzone.pojo.HostReply;

/**
 * @author Yang
 * @creat 20:59 2022/8/26
 * @sice 1.8
 */

public class HostReplyDAOImpl extends BaseDAO<HostReply> implements HostReplyDAO {
    @Override
    public HostReply getHostReplyByReply(Integer id) {
        return load("select * from t_host_reply where reply = ? ", id);
    }

    @Override
    public void delHostReply(Integer id) {
        executeUpdate("delete from t_host_reply where reply = ? ", id);
    }

    @Override
    public void addHostReply(HostReply hostReply) {
        executeUpdate("insert into t_host_reply values(0,?,?,?,?)", hostReply.getContent(), hostReply.getHostReplyDate(), hostReply.getAuthor().getId(), hostReply.getReply().getId());
    }
}
